<?php
defined('_JEXEC') or die('Restricted access');
if (! JFactory::getUser()->authorise('core.manage', 'com_raovat'))
{
    return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
if (! defined('DS'))
{
    define('DS', DIRECTORY_SEPARATOR);
}
$array_link = array(
        array(
                'id' => '',
                'text' => 'Select Website'
        ),
        array(
                'id' => 1,
                'text' => 'http://vnexpress.net'
        ),
        array(
                'id' => 2,
                'text' => 'http://www.thanhnien.com.vn'
        ),
        array(
                'id' => 3,
                'text' => 'http://www.tienphong.vn'
        ),
        array(
                'id' => 4,
                'text' => 'http://laodong.com.vn'
        ),
        array(
                'id' => 5,
                'text' => 'http://dantri.com.vn'
        ),
        array(
                'id' => 6,
                'text' => 'http://genk.vn'
        ),
        array(
                'id' => 7,
                'text' => 'http://www.vietnamplus.vn'
        ),
        array(
                'id' => 8,
                'text' => 'http://infonet.vn'
        ),
        array(
                'id' => 9,
                'text' => 'http://kinhdoanh.vnexpress.net'
        ),
        array(
                'id' => 10,
                'text' => 'http://thethao.vnexpress.net'
        ),

);
$_SESSION['ARRAY_LINK_WEB'] = $array_link;

require_once JPATH_COMPONENT . DS . 'lib' . DS . 'simple_html_dom.php';
require_once JPATH_COMPONENT . DS . 'lib' . DS . 'simple_rss_dom.php';
require_once JPATH_COMPONENT . DS . 'lib' . DS . 'rss_php.php';
require_once JPATH_COMPONENT . DS . 'lib' . DS . 'curl.php';
JLoader::register('LinkHelper', dirname(__FILE__) . DS . 'helpers' . DS . 'link.php');
jimport('joomla.application.component.controller');
$controller = JControllerLegacy::getInstance('Link');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();